//2009/08/26 01:19:01
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;
//Floyd...
class ImportsList
{
public:
    vector <int> importsCount(vector <string> requires)
    {
        int N = requires.size();
        vector<int> ret(N, 0);
        for (int i=0 ; i<N; i++)
            for (int j=0; j<N; j++)
                if (requires[i][j] =='Y')
                {
                    ret[i] ++;
                    for (int k=0; k<N; k++)
                        if (requires[i][k] =='Y' && requires[k][j] =='Y')
                        {cout << "i: " << i << ", j: " << j << ", k: " << k << endl;
                            ret[i]--;
                            break;
                        }
                }
        return ret;
    }
};
